home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / AIncludes / DriverServices.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  21.4 KB  |  844 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        DriverServices.a
  3. ;
  4. ;    Contains:    Driver Services Interfaces.
  5. ;
  6. ;    Version:    Technology:    PowerSurge 1.0.2
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1985-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__DRIVERSERVICES__') = 'UNDEFINED' THEN
  18. __DRIVERSERVICES__ SET 1
  19.  
  20.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  21.     include 'ConditionalMacros.a'
  22.     ENDIF
  23.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  24.     include 'MacTypes.a'
  25.     ENDIF
  26.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  27.     include 'Errors.a'
  28.     ENDIF
  29.     IF &TYPE('__MACHINEEXCEPTIONS__') = 'UNDEFINED' THEN
  30.     include 'MachineExceptions.a'
  31.     ENDIF
  32.     IF &TYPE('__DEVICES__') = 'UNDEFINED' THEN
  33.     include 'Devices.a'
  34.     ENDIF
  35.     IF &TYPE('__DRIVERSYNCHRONIZATION__') = 'UNDEFINED' THEN
  36.     include 'DriverSynchronization.a'
  37.     ENDIF
  38.  
  39. ; ******************************************************************
  40. ; *
  41. ; *         Previously in Kernel.h
  42. ; *
  43. ; *****************************************************************
  44.  
  45. ;  Kernel basics
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54. ;  OrderedItem stuff
  55. ; typedef OSType                         OrderedItemService
  56.  
  57. ; typedef OSType                         OrderedItemSignature
  58.  
  59.  
  60. kMatchAnyOrderedItemService        EQU        '****'
  61. kMatchAnyOrderedItemSignature    EQU        '****'
  62. kDoNotMatchAnyOrderedItemService EQU    '----'
  63. kDoNotMatchAnyOrderedItemSignature EQU    '----'
  64. OrderedItemName            RECORD 0
  65. service                     ds.l    1                ; offset: $0 (0)
  66. signature                 ds.l    1                ; offset: $4 (4)
  67. sizeof                     EQU *                    ; size:   $8 (8)
  68.                         ENDR
  69. ; typedef struct OrderedItemName *        OrderedItemNamePtr
  70.  
  71. ; typedef OptionBits                     OrderedItemOptions
  72.  
  73.  
  74. kOrderedItemIsRightBefore        EQU        $00000001
  75. kOrderedItemIsRightAfter        EQU        $00000002
  76. OrderRequirements        RECORD 0
  77. options                     ds.l    1                ; offset: $0 (0)
  78. itemBefore                 ds        OrderedItemName ; offset: $4 (4)
  79. itemAfter                 ds        OrderedItemName ; offset: $C (12)
  80. sizeof                     EQU *                    ; size:   $14 (20)
  81.                         ENDR
  82. ; typedef struct OrderRequirements *    OrderRequirementsPtr
  83.  
  84. ;  Tasking
  85. ; typedef UInt32                         ExecutionLevel
  86.  
  87.  
  88. kTaskLevel                        EQU        0
  89. kSoftwareInterruptLevel            EQU        1
  90. kAcceptFunctionLevel            EQU        2
  91. kKernelLevel                    EQU        3
  92. kSIHAcceptFunctionLevel            EQU        4
  93. kSecondaryInterruptLevel        EQU        5
  94. kHardwareInterruptLevel            EQU        6
  95.  
  96. kCurrentAddressSpaceID            EQU        -1
  97.  
  98. ;  Memory System basics
  99. LogicalAddressRange        RECORD 0
  100. address                     ds.l    1                ; offset: $0 (0)
  101. count                     ds.l    1                ; offset: $4 (4)
  102. sizeof                     EQU *                    ; size:   $8 (8)
  103.                         ENDR
  104. ; typedef struct LogicalAddressRange *    LogicalAddressRangePtr
  105.  
  106. PhysicalAddressRange    RECORD 0
  107. address                     ds.l    1                ; offset: $0 (0)
  108. count                     ds.l    1                ; offset: $4 (4)
  109. sizeof                     EQU *                    ; size:   $8 (8)
  110.                         ENDR
  111. ; typedef struct PhysicalAddressRange *    PhysicalAddressRangePtr
  112.  
  113. ;  For PrepareMemoryForIO and CheckpointIO
  114. ; typedef OptionBits                     IOPreparationOptions
  115.  
  116.  
  117. kIOMultipleRanges                EQU        $00000001
  118. kIOLogicalRanges                EQU        $00000002
  119. kIOMinimalLogicalMapping        EQU        $00000004
  120. kIOShareMappingTables            EQU        $00000008
  121. kIOIsInput                        EQU        $00000010
  122. kIOIsOutput                        EQU        $00000020
  123. kIOCoherentDataPath                EQU        $00000040
  124. kIOTransferIsLogical            EQU        $00000080
  125. kIOClientIsUserMode                EQU        $00000080
  126. ; typedef OptionBits                     IOPreparationState
  127.  
  128.  
  129. kIOStateDone                    EQU        $00000001
  130.  
  131. kInvalidPageAddress                EQU        -1
  132. AddressRange            RECORD 0
  133. base                     ds.l    1                ; offset: $0 (0)
  134. length                     ds.l    1                ; offset: $4 (4)
  135. sizeof                     EQU *                    ; size:   $8 (8)
  136.                         ENDR
  137. ;  C's treatment of arrays and array pointers is atypical
  138. LogicalMappingTable        RECORD 0
  139. elements                 ds.l    1
  140. sizeof                     EQU *                    ; size:   $4 (4)
  141.                         ENDR
  142.  
  143.  
  144. ; typedef LogicalMappingTable *            LogicalMappingTablePtr
  145.  
  146. PhysicalMappingTable    RECORD 0
  147. elements                 ds.l    1
  148. sizeof                     EQU *                    ; size:   $4 (4)
  149.                         ENDR
  150.  
  151.  
  152. ; typedef PhysicalMappingTable *        PhysicalMappingTablePtr
  153.  
  154. AddressRangeTable        RECORD 0
  155. elements                 ds.b    1 * AddressRange.sizeof
  156. sizeof                     EQU *                    ; size:   $8 (8)
  157.                         ENDR
  158.  
  159.  
  160. ; typedef AddressRangeTable *            AddressRangeTablePtr
  161.  
  162. MultipleAddressRange    RECORD 0
  163. entryCount                 ds.l    1                ; offset: $0 (0)
  164. rangeTable                 ds.l    1                ; offset: $4 (4)
  165. sizeof                     EQU *                    ; size:   $8 (8)
  166.                         ENDR
  167.  
  168. ;   Separate C definition so that union has a name.  A future version of the interfacer
  169. ;   tool will allow a name (that gets thrown out in Pascal and Asm).
  170.  
  171.  
  172. IOPreparationTable        RECORD 0
  173. options                     ds.l    1                ; offset: $0 (0)
  174. state                     ds.l    1                ; offset: $4 (4)
  175. preparationID             ds.l    1                ; offset: $8 (8)
  176. addressSpace             ds.l    1                ; offset: $C (12)
  177. granularity                 ds.l    1                ; offset: $10 (16)
  178. firstPrepared             ds.l    1                ; offset: $14 (20)
  179. lengthPrepared             ds.l    1                ; offset: $18 (24)
  180. mappingEntryCount         ds.l    1                ; offset: $1C (28)
  181. logicalMapping             ds.l    1                ; offset: $20 (32)
  182. physicalMapping             ds.l    1                ; offset: $24 (36)
  183. range                     ds        AddressRange    ; offset: $28 (40)
  184.                          ORG 40
  185. multipleRanges             ds        MultipleAddressRange ; offset: $28 (40)
  186. sizeof                     EQU *                    ; size:   $30 (48)
  187.                         ENDR
  188. ; typedef OptionBits                     IOCheckpointOptions
  189.  
  190.  
  191. kNextIOIsInput                    EQU        $00000001
  192. kNextIOIsOutput                    EQU        $00000002
  193. kMoreIOTransfers                EQU        $00000004
  194. ;  For SetProcessorCacheMode
  195.  
  196. ; typedef UInt32                         ProcessorCacheMode
  197.  
  198.  
  199. kProcessorCacheModeDefault        EQU        0
  200. kProcessorCacheModeInhibited    EQU        1
  201. kProcessorCacheModeWriteThrough    EQU        2
  202. kProcessorCacheModeCopyBack        EQU        3
  203.  
  204. ;   For GetPageInformation
  205. ;   (Note: if kPageInformationVersion fails, try 0 -- old versions of DSL defined  kPageInformationVersion as 0)
  206.  
  207.  
  208.  
  209.  
  210. kPageInformationVersion            EQU        1
  211. ; typedef UInt32                         PageStateInformation
  212.  
  213.  
  214. kPageIsProtected                EQU        $00000001
  215. kPageIsProtectedPrivileged        EQU        $00000002
  216. kPageIsModified                    EQU        $00000004
  217. kPageIsReferenced                EQU        $00000008
  218. kPageIsLockedResident            EQU        $00000010            ; held and locked resident
  219. kPageIsInMemory                    EQU        $00000020
  220. kPageIsShared                    EQU        $00000040
  221. kPageIsWriteThroughCached        EQU        $00000080
  222. kPageIsCopyBackCached            EQU        $00000100
  223. kPageIsHeldResident                EQU        $00000200            ; held resident - use kPageIsLockedResident to check for locked state
  224. kPageIsLocked                    EQU        $00000010            ; Deprecated
  225. kPageIsResident                    EQU        $00000020            ; Deprecated
  226. PageInformation            RECORD 0
  227. area                     ds.l    1                ; offset: $0 (0)
  228. count                     ds.l    1                ; offset: $4 (4)
  229. information                 ds.l    1                ; offset: $8 (8) <-- really an array of length one
  230. sizeof                     EQU *                    ; size:   $C (12)
  231.                         ENDR
  232. ; typedef struct PageInformation *        PageInformationPtr
  233.  
  234.  
  235. ;   Tasks  
  236. ;
  237. ; extern ExecutionLevel CurrentExecutionLevel(void )
  238. ;
  239.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  240.         IMPORT_CFM_FUNCTION CurrentExecutionLevel
  241.     ENDIF
  242.  
  243. ;
  244. ; extern TaskID CurrentTaskID(void )
  245. ;
  246.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  247.         IMPORT_CFM_FUNCTION CurrentTaskID
  248.     ENDIF
  249.  
  250. ;
  251. ; extern OSStatus DelayFor(Duration delayDuration)
  252. ;
  253.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  254.         IMPORT_CFM_FUNCTION DelayFor
  255.     ENDIF
  256.  
  257. ;
  258. ; extern Boolean InPrivilegedMode(void )
  259. ;
  260.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  261.         IMPORT_CFM_FUNCTION InPrivilegedMode
  262.     ENDIF
  263.  
  264.  
  265. ;   Software Interrupts  
  266. ;
  267. ; extern OSStatus CreateSoftwareInterrupt(SoftwareInterruptHandler handler, TaskID task, void *p1, Boolean persistent, SoftwareInterruptID *theSoftwareInterrupt)
  268. ;
  269.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  270.         IMPORT_CFM_FUNCTION CreateSoftwareInterrupt
  271.     ENDIF
  272.  
  273.  
  274. ;
  275. ; extern OSStatus SendSoftwareInterrupt(SoftwareInterruptID theSoftwareInterrupt, void *p2)
  276. ;
  277.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  278.         IMPORT_CFM_FUNCTION SendSoftwareInterrupt
  279.     ENDIF
  280.  
  281. ;
  282. ; extern OSStatus DeleteSoftwareInterrupt(SoftwareInterruptID theSoftwareInterrupt)
  283. ;
  284.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  285.         IMPORT_CFM_FUNCTION DeleteSoftwareInterrupt
  286.     ENDIF
  287.  
  288.     IF TARGET_OS_MAC THEN
  289. ;   Secondary Interrupts  
  290. ;
  291. ; extern OSStatus CallSecondaryInterruptHandler2(SecondaryInterruptHandler2 theHandler, ExceptionHandler exceptionHandler, void *p1, void *p2)
  292. ;
  293.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  294.         IMPORT_CFM_FUNCTION CallSecondaryInterruptHandler2
  295.     ENDIF
  296.  
  297. ;
  298. ; extern OSStatus QueueSecondaryInterruptHandler(SecondaryInterruptHandler2 theHandler, ExceptionHandler exceptionHandler, void *p1, void *p2)
  299. ;
  300.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  301.         IMPORT_CFM_FUNCTION QueueSecondaryInterruptHandler
  302.     ENDIF
  303.  
  304.     ENDIF    ; TARGET_OS_MAC
  305. ;   Timers  
  306. ;
  307. ; extern OSStatus SetInterruptTimer(const AbsoluteTime *expirationTime, SecondaryInterruptHandler2 handler, void *p1, TimerID *theTimer)
  308. ;
  309.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  310.         IMPORT_CFM_FUNCTION SetInterruptTimer
  311.     ENDIF
  312.  
  313. ;
  314. ; extern OSStatus CancelTimer(TimerID theTimer, AbsoluteTime *timeRemaining)
  315. ;
  316.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  317.         IMPORT_CFM_FUNCTION CancelTimer
  318.     ENDIF
  319.  
  320.  
  321. ;   I/O related Operations  
  322. ;
  323. ; extern OSStatus PrepareMemoryForIO(IOPreparationTable *theIOPreparationTable)
  324. ;
  325.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  326.         IMPORT_CFM_FUNCTION PrepareMemoryForIO
  327.     ENDIF
  328.  
  329. ;
  330. ; extern OSStatus CheckpointIO(IOPreparationID theIOPreparation, IOCheckpointOptions options)
  331. ;
  332.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  333.         IMPORT_CFM_FUNCTION CheckpointIO
  334.     ENDIF
  335.  
  336.  
  337. ;   Memory Operations  
  338. ;
  339. ; extern OSStatus GetPageInformation(AddressSpaceID addressSpace, ConstLogicalAddress base, ByteCount length, PBVersion version, PageInformation *thePageInfo)
  340. ;
  341.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  342.         IMPORT_CFM_FUNCTION GetPageInformation
  343.     ENDIF
  344.  
  345. ;   Processor Cache Related  
  346. ;
  347. ; extern OSStatus SetProcessorCacheMode(AddressSpaceID addressSpace, ConstLogicalAddress base, ByteCount length, ProcessorCacheMode cacheMode)
  348. ;
  349.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  350.         IMPORT_CFM_FUNCTION SetProcessorCacheMode
  351.     ENDIF
  352.  
  353. ; ******************************************************************
  354. ; *
  355. ; *         Was in DriverSupport.h or DriverServices.h
  356. ; *
  357. ; *****************************************************************
  358.  
  359. ; typedef LogicalAddress *                DeviceLogicalAddressPtr
  360.  
  361.  
  362. durationMicrosecond                EQU        -1                    ; Microseconds are negative
  363. durationMillisecond                EQU        1                    ; Milliseconds are positive
  364. durationSecond                    EQU        1000                ; 1000 * durationMillisecond
  365. durationMinute                    EQU        60000                ; 60 * durationSecond,
  366. durationHour                    EQU        3600000                ; 60 * durationMinute,
  367. durationDay                        EQU        86400000            ; 24 * durationHour,
  368. durationNoWait                    EQU        0                    ; don't block
  369. durationForever                    EQU        $7FFFFFFF            ; no time limit
  370.  
  371. k8BitAccess                        EQU        0                    ; access as 8 bit
  372. k16BitAccess                    EQU        1                    ; access as 16 bit
  373. k32BitAccess                    EQU        2                    ; access as 32 bit
  374. Nanoseconds                RECORD 0
  375. f                         ds        UnsignedWide
  376. sizeof                     EQU *                    ; size:   $8 (8)
  377.                         ENDR
  378.  
  379.  
  380.  
  381. ;
  382. ; extern OSErr IOCommandIsComplete(IOCommandID theID, OSErr theResult)
  383. ;
  384.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  385.         IMPORT_CFM_FUNCTION IOCommandIsComplete
  386.     ENDIF
  387.  
  388. ;
  389. ; extern OSErr GetIOCommandInfo(IOCommandID theID, IOCommandContents *theContents, IOCommandCode *theCommand, IOCommandKind *theKind)
  390. ;
  391.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  392.         IMPORT_CFM_FUNCTION GetIOCommandInfo
  393.     ENDIF
  394.  
  395. ;
  396. ; extern void UpdateDeviceActivity(RegEntryID *deviceEntry)
  397. ;
  398.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  399.         IMPORT_CFM_FUNCTION UpdateDeviceActivity
  400.     ENDIF
  401.  
  402. ;
  403. ; extern void BlockCopy(const void *srcPtr, void *destPtr, Size byteCount)
  404. ;
  405.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  406.         IMPORT_CFM_FUNCTION BlockCopy
  407.     ENDIF
  408.  
  409. ;
  410. ; extern LogicalAddress PoolAllocateResident(ByteCount byteSize, Boolean clear)
  411. ;
  412.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  413.         IMPORT_CFM_FUNCTION PoolAllocateResident
  414.     ENDIF
  415.  
  416. ;
  417. ; extern OSStatus PoolDeallocate(LogicalAddress address)
  418. ;
  419.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  420.         IMPORT_CFM_FUNCTION PoolDeallocate
  421.     ENDIF
  422.  
  423. ;
  424. ; extern ByteCount GetLogicalPageSize(void )
  425. ;
  426.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  427.         IMPORT_CFM_FUNCTION GetLogicalPageSize
  428.     ENDIF
  429.  
  430. ;
  431. ; extern ByteCount GetDataCacheLineSize(void )
  432. ;
  433.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  434.         IMPORT_CFM_FUNCTION GetDataCacheLineSize
  435.     ENDIF
  436.  
  437. ;
  438. ; extern OSStatus FlushProcessorCache(AddressSpaceID spaceID, LogicalAddress base, ByteCount length)
  439. ;
  440.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  441.         IMPORT_CFM_FUNCTION FlushProcessorCache
  442.     ENDIF
  443.  
  444. ;
  445. ; extern LogicalAddress MemAllocatePhysicallyContiguous(ByteCount byteSize, Boolean clear)
  446. ;
  447.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  448.         IMPORT_CFM_FUNCTION MemAllocatePhysicallyContiguous
  449.     ENDIF
  450.  
  451. ;
  452. ; extern OSStatus MemDeallocatePhysicallyContiguous(LogicalAddress address)
  453. ;
  454.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  455.         IMPORT_CFM_FUNCTION MemDeallocatePhysicallyContiguous
  456.     ENDIF
  457.  
  458.  
  459. ;
  460. ; extern AbsoluteTime UpTime(void )
  461. ;
  462.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  463.         IMPORT_CFM_FUNCTION UpTime
  464.     ENDIF
  465.  
  466. ;
  467. ; extern void GetTimeBaseInfo(UInt32 *minAbsoluteTimeDelta, UInt32 *theAbsoluteTimeToNanosecondNumerator, UInt32 *theAbsoluteTimeToNanosecondDenominator, UInt32 *theProcessorToAbsoluteTimeNumerator, UInt32 *theProcessorToAbsoluteTimeDenominator)
  468. ;
  469.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  470.         IMPORT_CFM_FUNCTION GetTimeBaseInfo
  471.     ENDIF
  472.  
  473.  
  474. ;
  475. ; extern Nanoseconds AbsoluteToNanoseconds(AbsoluteTime absoluteTime)
  476. ;
  477.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  478.         IMPORT_CFM_FUNCTION AbsoluteToNanoseconds
  479.     ENDIF
  480.  
  481. ;
  482. ; extern Duration AbsoluteToDuration(AbsoluteTime absoluteTime)
  483. ;
  484.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  485.         IMPORT_CFM_FUNCTION AbsoluteToDuration
  486.     ENDIF
  487.  
  488. ;
  489. ; extern AbsoluteTime NanosecondsToAbsolute(Nanoseconds nanoseconds)
  490. ;
  491.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  492.         IMPORT_CFM_FUNCTION NanosecondsToAbsolute
  493.     ENDIF
  494.  
  495. ;
  496. ; extern AbsoluteTime DurationToAbsolute(Duration duration)
  497. ;
  498.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  499.         IMPORT_CFM_FUNCTION DurationToAbsolute
  500.     ENDIF
  501.  
  502. ;
  503. ; extern AbsoluteTime AddAbsoluteToAbsolute(AbsoluteTime absoluteTime1, AbsoluteTime absoluteTime2)
  504. ;
  505.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  506.         IMPORT_CFM_FUNCTION AddAbsoluteToAbsolute
  507.     ENDIF
  508.  
  509. ;
  510. ; extern AbsoluteTime SubAbsoluteFromAbsolute(AbsoluteTime leftAbsoluteTime, AbsoluteTime rightAbsoluteTime)
  511. ;
  512.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  513.         IMPORT_CFM_FUNCTION SubAbsoluteFromAbsolute
  514.     ENDIF
  515.  
  516. ;
  517. ; extern AbsoluteTime AddNanosecondsToAbsolute(Nanoseconds nanoseconds, AbsoluteTime absoluteTime)
  518. ;
  519.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  520.         IMPORT_CFM_FUNCTION AddNanosecondsToAbsolute
  521.     ENDIF
  522.  
  523. ;
  524. ; extern AbsoluteTime AddDurationToAbsolute(Duration duration, AbsoluteTime absoluteTime)
  525. ;
  526.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  527.         IMPORT_CFM_FUNCTION AddDurationToAbsolute
  528.     ENDIF
  529.  
  530. ;
  531. ; extern AbsoluteTime SubNanosecondsFromAbsolute(Nanoseconds nanoseconds, AbsoluteTime absoluteTime)
  532. ;
  533.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  534.         IMPORT_CFM_FUNCTION SubNanosecondsFromAbsolute
  535.     ENDIF
  536.  
  537. ;
  538. ; extern AbsoluteTime SubDurationFromAbsolute(Duration duration, AbsoluteTime absoluteTime)
  539. ;
  540.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  541.         IMPORT_CFM_FUNCTION SubDurationFromAbsolute
  542.     ENDIF
  543.  
  544. ;
  545. ; extern Nanoseconds AbsoluteDeltaToNanoseconds(AbsoluteTime leftAbsoluteTime, AbsoluteTime rightAbsoluteTime)
  546. ;
  547.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  548.         IMPORT_CFM_FUNCTION AbsoluteDeltaToNanoseconds
  549.     ENDIF
  550.  
  551. ;
  552. ; extern Duration AbsoluteDeltaToDuration(AbsoluteTime leftAbsoluteTime, AbsoluteTime rightAbsoluteTime)
  553. ;
  554.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  555.         IMPORT_CFM_FUNCTION AbsoluteDeltaToDuration
  556.     ENDIF
  557.  
  558. ;
  559. ; extern Nanoseconds DurationToNanoseconds(Duration theDuration)
  560. ;
  561.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  562.         IMPORT_CFM_FUNCTION DurationToNanoseconds
  563.     ENDIF
  564.  
  565. ;
  566. ; extern Duration NanosecondsToDuration(Nanoseconds theNanoseconds)
  567. ;
  568.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  569.         IMPORT_CFM_FUNCTION NanosecondsToDuration
  570.     ENDIF
  571.  
  572.  
  573. ;
  574. ; extern OSErr PBQueueInit(QHdrPtr qHeader)
  575. ;
  576.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  577.         IMPORT_CFM_FUNCTION PBQueueInit
  578.     ENDIF
  579.  
  580. ;
  581. ; extern OSErr PBQueueCreate(QHdrPtr *qHeader)
  582. ;
  583.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  584.         IMPORT_CFM_FUNCTION PBQueueCreate
  585.     ENDIF
  586.  
  587. ;
  588. ; extern OSErr PBQueueDelete(QHdrPtr qHeader)
  589. ;
  590.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  591.         IMPORT_CFM_FUNCTION PBQueueDelete
  592.     ENDIF
  593.  
  594. ;
  595. ; extern void PBEnqueue(QElemPtr qElement, QHdrPtr qHeader)
  596. ;
  597.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  598.         IMPORT_CFM_FUNCTION PBEnqueue
  599.     ENDIF
  600.  
  601. ;
  602. ; extern OSErr PBEnqueueLast(QElemPtr qElement, QHdrPtr qHeader)
  603. ;
  604.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  605.         IMPORT_CFM_FUNCTION PBEnqueueLast
  606.     ENDIF
  607.  
  608. ;
  609. ; extern OSErr PBDequeue(QElemPtr qElement, QHdrPtr qHeader)
  610. ;
  611.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  612.         IMPORT_CFM_FUNCTION PBDequeue
  613.     ENDIF
  614.  
  615. ;
  616. ; extern OSErr PBDequeueFirst(QHdrPtr qHeader, QElemPtr *theFirstqElem)
  617. ;
  618.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  619.         IMPORT_CFM_FUNCTION PBDequeueFirst
  620.     ENDIF
  621.  
  622. ;
  623. ; extern OSErr PBDequeueLast(QHdrPtr qHeader, QElemPtr *theLastqElem)
  624. ;
  625.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  626.         IMPORT_CFM_FUNCTION PBDequeueLast
  627.     ENDIF
  628.  
  629. ;
  630. ; extern char *CStrCopy(char *dst, const char *src)
  631. ;
  632.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  633.         IMPORT_CFM_FUNCTION CStrCopy
  634.     ENDIF
  635.  
  636. ;
  637. ; extern StringPtr PStrCopy(StringPtr dst, ConstStr255Param src)
  638. ;
  639.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  640.         IMPORT_CFM_FUNCTION PStrCopy
  641.     ENDIF
  642.  
  643. ;
  644. ; extern char *CStrNCopy(char *dst, const char *src, UInt32 max)
  645. ;
  646.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  647.         IMPORT_CFM_FUNCTION CStrNCopy
  648.     ENDIF
  649.  
  650. ;
  651. ; extern StringPtr PStrNCopy(StringPtr dst, ConstStr255Param src, UInt32 max)
  652. ;
  653.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  654.         IMPORT_CFM_FUNCTION PStrNCopy
  655.     ENDIF
  656.  
  657. ;
  658. ; extern char *CStrCat(char *dst, const char *src)
  659. ;
  660.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  661.         IMPORT_CFM_FUNCTION CStrCat
  662.     ENDIF
  663.  
  664. ;
  665. ; extern StringPtr PStrCat(StringPtr dst, ConstStr255Param src)
  666. ;
  667.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  668.         IMPORT_CFM_FUNCTION PStrCat
  669.     ENDIF
  670.  
  671. ;
  672. ; extern char *CStrNCat(char *dst, const char *src, UInt32 max)
  673. ;
  674.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  675.         IMPORT_CFM_FUNCTION CStrNCat
  676.     ENDIF
  677.  
  678. ;
  679. ; extern StringPtr PStrNCat(StringPtr dst, ConstStr255Param src, UInt32 max)
  680. ;
  681.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  682.         IMPORT_CFM_FUNCTION PStrNCat
  683.     ENDIF
  684.  
  685. ;
  686. ; extern void PStrToCStr(char *dst, ConstStr255Param src)
  687. ;
  688.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  689.         IMPORT_CFM_FUNCTION PStrToCStr
  690.     ENDIF
  691.  
  692. ;
  693. ; extern void CStrToPStr(Str255 dst, const char *src)
  694. ;
  695.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  696.         IMPORT_CFM_FUNCTION CStrToPStr
  697.     ENDIF
  698.  
  699. ;
  700. ; extern SInt16 CStrCmp(const char *s1, const char *s2)
  701. ;
  702.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  703.         IMPORT_CFM_FUNCTION CStrCmp
  704.     ENDIF
  705.  
  706. ;
  707. ; extern SInt16 PStrCmp(ConstStr255Param str1, ConstStr255Param str2)
  708. ;
  709.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  710.         IMPORT_CFM_FUNCTION PStrCmp
  711.     ENDIF
  712.  
  713. ;
  714. ; extern SInt16 CStrNCmp(const char *s1, const char *s2, UInt32 max)
  715. ;
  716.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  717.         IMPORT_CFM_FUNCTION CStrNCmp
  718.     ENDIF
  719.  
  720. ;
  721. ; extern SInt16 PStrNCmp(ConstStr255Param str1, ConstStr255Param str2, UInt32 max)
  722. ;
  723.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  724.         IMPORT_CFM_FUNCTION PStrNCmp
  725.     ENDIF
  726.  
  727. ;
  728. ; extern UInt32 CStrLen(const char *src)
  729. ;
  730.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  731.         IMPORT_CFM_FUNCTION CStrLen
  732.     ENDIF
  733.  
  734. ;
  735. ; extern UInt32 PStrLen(ConstStr255Param src)
  736. ;
  737.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  738.         IMPORT_CFM_FUNCTION PStrLen
  739.     ENDIF
  740.  
  741. ;
  742. ; extern OSStatus DeviceProbe(void *theSrc, void *theDest, UInt32 AccessType)
  743. ;
  744.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  745.         IMPORT_CFM_FUNCTION DeviceProbe
  746.     ENDIF
  747.  
  748. ;
  749. ; extern OSStatus DelayForHardware(AbsoluteTime absoluteTime)
  750. ;
  751.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  752.         IMPORT_CFM_FUNCTION DelayForHardware
  753.     ENDIF
  754.  
  755.  
  756.  
  757. ; ******************************************************************
  758. ; *
  759. ; *         Was in Interrupts.h 
  760. ; *
  761. ; *****************************************************************
  762.  
  763. ;   Interrupt types  
  764.  
  765.  
  766. ; typedef long                             InterruptMemberNumber
  767.  
  768. InterruptSetMember        RECORD 0
  769. setID                     ds.l    1                ; offset: $0 (0)
  770. member                     ds.l    1                ; offset: $4 (4)
  771. sizeof                     EQU *                    ; size:   $8 (8)
  772.                         ENDR
  773.  
  774. kISTChipInterruptSource            EQU        0
  775. kISTOutputDMAInterruptSource    EQU        1
  776. kISTInputDMAInterruptSource        EQU        2
  777. kISTPropertyMemberCount            EQU        3
  778. ISTProperty                RECORD 0
  779. elements                 ds.b    3 * InterruptSetMember.sizeof
  780. sizeof                     EQU *                    ; size:   $18 (24)
  781.                         ENDR
  782.  
  783.  
  784. ; typedef long                             InterruptReturnValue
  785.  
  786.  
  787. kFirstMemberNumber                EQU        1
  788. kIsrIsComplete                    EQU        0
  789. kIsrIsNotComplete                EQU        -1
  790. kMemberNumberParent                EQU        -2
  791. ; typedef Boolean                         InterruptSourceState
  792.  
  793.  
  794. kSourceWasEnabled                EQU        1
  795. kSourceWasDisabled                EQU        0
  796.  
  797.  
  798. kReturnToParentWhenComplete        EQU        $00000001
  799. kReturnToParentWhenNotComplete    EQU        $00000002
  800. ; typedef OptionBits                     InterruptSetOptions
  801.  
  802. ;   Interrupt Services  
  803. ;
  804. ; extern OSStatus CreateInterruptSet(InterruptSetID parentSet, InterruptMemberNumber parentMember, InterruptMemberNumber setSize, InterruptSetID *setID, InterruptSetOptions options)
  805. ;
  806.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  807.         IMPORT_CFM_FUNCTION CreateInterruptSet
  808.     ENDIF
  809.  
  810.  
  811. ;
  812. ; extern OSStatus InstallInterruptFunctions(InterruptSetID setID, InterruptMemberNumber member, void *refCon, InterruptHandler handlerFunction, InterruptEnabler enableFunction, InterruptDisabler disableFunction)
  813. ;
  814.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  815.         IMPORT_CFM_FUNCTION InstallInterruptFunctions
  816.     ENDIF
  817.  
  818.  
  819. ;
  820. ; extern OSStatus GetInterruptFunctions(InterruptSetID setID, InterruptMemberNumber member, void **refCon, InterruptHandler *handlerFunction, InterruptEnabler *enableFunction, InterruptDisabler *disableFunction)
  821. ;
  822.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  823.         IMPORT_CFM_FUNCTION GetInterruptFunctions
  824.     ENDIF
  825.  
  826. ;
  827. ; extern OSStatus ChangeInterruptSetOptions(InterruptSetID setID, InterruptSetOptions options)
  828. ;
  829.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  830.         IMPORT_CFM_FUNCTION ChangeInterruptSetOptions
  831.     ENDIF
  832.  
  833. ;
  834. ; extern OSStatus GetInterruptSetOptions(InterruptSetID setID, InterruptSetOptions *options)
  835. ;
  836.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  837.         IMPORT_CFM_FUNCTION GetInterruptSetOptions
  838.     ENDIF
  839.  
  840.  
  841.  
  842.     ENDIF ; __DRIVERSERVICES__ 
  843.  
  844.